﻿<%@ Page Title="Users" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" 
	Inherits="System.Web.Mvc.ViewPage<User>" %>
<%@ Import Namespace="MindMelder.Web.Controllers"%>
<%@ Import Namespace="MindMelder.Core" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    <h2>Messages</h2>

    <% if (ViewContext.TempData["message"] != null){ %>
        <p><%= ViewContext.TempData["message"]%></p>
    <% } %>

	<div>
		<% foreach (Message message in ViewData.Model.Messages) { %>
			<span><%= message.Text %></span>
			<span> - from <%= Html.ActionLink(message.Sender.FullName, "Show", new RouteValueDictionary { { "Id", message.Sender.Id } })%></span>
			<br />
		<%} %>
	</div>
</asp:Content>